package org.example.printstream;

import java.io.FileNotFoundException;
import java.io.PrintWriter;

/**
 * printWriter写数据到文件
 */
public class PrintWriterDemo {

    public static void main(String[] args) throws FileNotFoundException {

        //经验证，pw.txt,写到项目根目录去了
        PrintWriter pw = new PrintWriter("pw.txt");

        pw.println(true);
        pw.print(111);
        pw.println("xxxxxxxx");
        pw.print('c');

        pw.flush();
        pw.close();

    }
}
